const app = getApp()

Page({
  data: {
    avatarUrl: './user-unlogin.png',
    userInfo: {},
    logged: false,
    takeSession: false,
    requestResult: '',
    result: ''
  },

  onLoad: function(options) {
    console.log("页面加载")
    },

  onReady: function () {
    console.log("页面初次渲染完成")
  },

  onShow: function () {
    console.log("页面显示")
  },
  onPullDownRefresh: function () {
    console.log("此时用户下拉触顶")
  },

  onReachBottom: function () {
    console.log("此时用户上拉触底")
  },

  onPageScroll: function (options) {
    console.log("此时用户正在滚动页面")
    console.log("滚动距离：" + options.scrollTop)
  },
  num1: 0,
  num2: 0,
  num1change: function (e){
     this.num1 = Number(e.detail.value)
     console.log('第1个数字为' + this.num1)
  },
  
  num2change: function (e){
     this.num2 = Number(e.detail.value)
     console.log('第2个数字为' + this.num2)
  },
  compare: function (e) {
    console.log("比较按钮被单击了")
    console.log(e)
    var str = "两数相等"
    if (this.num1 > this.num2){
      str = "第一个数大"
    }else if (this.num1 < this.num2){
      str = "第二个数大"
    }
    this.setData({result:str})
  }

  
 })
